package edu.pku.dao;

import java.sql.SQLException;
import java.util.List;

import com.ibatis.sqlmap.client.SqlMapClient;

import edu.pku.data.InAskPrice;
import edu.pku.util.MySqlMapClient;

public class InAskPriceDao {
	
	public void addInAskPrice(InAskPrice iap) throws SQLException
	{
		SqlMapClient sqlMap = MySqlMapClient.getSqlMapInstance();
		sqlMap.insert("insert_in_askprice",iap);
	}
	
	public void updateInAskPrice(InAskPrice iap) throws SQLException
	{
		SqlMapClient sqlMap = MySqlMapClient.getSqlMapInstance();
		sqlMap.update("update_in_askprice",iap);
	}
	
	public List<InAskPrice> getInAskPrices(String companyName) throws SQLException
	{
		SqlMapClient sqlMap = MySqlMapClient.getSqlMapInstance();
		List<InAskPrice> list =  sqlMap.queryForList("get_in_askprices",companyName);
		return list;
	}
	
	public void deleteInAskPrice(InAskPrice iap) throws SQLException
	{
		SqlMapClient sqlMap = MySqlMapClient.getSqlMapInstance();
		sqlMap.delete("delete_in_askprice",iap);
	}
	
	
}
